home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / src / out-of-phase-102-c / OutOfPhase 1.02 Source / OutOfPhase Folder / Level 1 Extensions 29Sep94 / SimpleButton.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-23  |  2.1 KB  |  59 lines  |  [TEXT/KAHL]

  1. /* SimpleButton.h */
  2.  
  3. #ifndef Included_SimpleButton_h
  4. #define Included_SimpleButton_h
  5.  
  6. /* SimpleButton module depends on: */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* Memory */
  12. /* Screen */
  13. /* DataMunging */
  14. /* EventLoop */
  15.  
  16. #include "Screen.h"
  17.  
  18. struct SimpleButtonRec;
  19. typedef struct SimpleButtonRec SimpleButtonRec;
  20.  
  21. /* allocate the simple button.  Name is null terminated */
  22. SimpleButtonRec*        NewSimpleButton(WinType* Window, char* Name,
  23.                                             OrdType X, OrdType Y, OrdType Width, OrdType Height);
  24.  
  25. /* dispose of the button and internal data */
  26. void                                DisposeSimpleButton(SimpleButtonRec* TheButton);
  27.  
  28. /* indicate whether this button is a default button or not.  if it is, it will */
  29. /* be hilighted specially (heavy outline).  It will NOT be drawn though */
  30. void                                SetDefaultButtonState(SimpleButtonRec* TheButton, MyBoolean Default);
  31.  
  32. /* find out where the button is located */
  33. OrdType                            GetSimpleButtonXLoc(SimpleButtonRec* TheButton);
  34. OrdType                            GetSimpleButtonYLoc(SimpleButtonRec* TheButton);
  35. OrdType                            GetSimpleButtonWidth(SimpleButtonRec* TheButton);
  36. OrdType                            GetSimpleButtonHeight(SimpleButtonRec* TheButton);
  37.  
  38. /* change the location of the button */
  39. void                                SetSimpleButtonLocation(SimpleButtonRec* TheButton,
  40.                                             OrdType X, OrdType Y, OrdType Width, OrdType Height);
  41.  
  42. /* do a full redraw of the button */
  43. void                                RedrawSimpleButton(SimpleButtonRec* TheButton);
  44.  
  45. /* do a mouse down in the button.  if Tracking != NIL, then it will be repeatedly */
  46. /* called with the Inside status until the mouse goes up */
  47. MyBoolean                        SimpleButtonMouseDown(SimpleButtonRec* TheButton, OrdType X, OrdType Y,
  48.                                             void (*Tracking)(void* Refcon, MyBoolean Inside), void* Refcon);
  49.  
  50. /* momentarily flash the button.  this is used to provide visual feedback in case */
  51. /* a key press performs the same function as clicking the button. */
  52. void                                FlashButton(SimpleButtonRec* TheButton);
  53.  
  54. /* find out if the specified location is within the button box */
  55. MyBoolean                        SimpleButtonHitTest(SimpleButtonRec* TheButton, OrdType X,
  56.                                             OrdType Y);
  57.  
  58. #endif
  59.